<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>异常工单详情</title>
    <link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/common.css" />
    <link rel="stylesheet" href="../css/page_css/util.css">
    <style type="text/css">
        .mui-card-footer .mui-card-link {
            font-size: 12px;
            height: 35px;
            line-height: 35px;
        }

        .mui-table-view-cell.line:after,
        .mui-table-view.line:after {
            height: 0;
        }

        .mui-checkbox input[type=checkbox]:before {
            font-size: 24px;
        }

        .title_ {
            color: #333333;
            font-weight: bold;
        }

        .detail {
            padding-right: 20px!important;
        }
        .text_blod{
          color: #000;
          font-weight: bold;
        }

        .noneTopLine:before {
            height: 0!important;
        }

        .mui-table-view::before {
            height: 0;
        }

        .mui-table-view-cell.mui-collapse .mui-table-view .mui-table-view-cell {
            padding-right: 31px;
        }

        .mui-table-view-cell::before {
            height: 0;
        }

        .content-padded_top>.mui-table-view>.mui-table-view-cell {
            padding: 0 15px;
        }

        .mui-card-footer::before {
            height: 0;
        }

        .mui-radio input[type=radio] {
            top: -4px !important;
        }

        .text_right {
            text-align: right;
        }

        .padding_15 {
            padding: 15px !important;
        }
        .tpl_box{
          border: 1px solid #efefef;
          border-radius: 5px;
          margin-bottom: 15px
        }
        .list>.mui-table-view-cell>ul>.mui-table-view-cell {
            padding-top: 3px !important;
            padding-bottom: 3px !important;
        }

        .list>.mui-table-view-cell>ul>.mui-table-view-cell:after {
            height: 0 !important;
        }

        .list>.mui-table-view-cell>ul>.mui-table-view-cell .mui-card-footer {
            padding-top: 0 !important;
            padding: 0 !important;
            min-height: 24px !important;
        }

        .list>.mui-table-view-cell>ul>.mui-table-view-cell .mui-card-footer::before {
            height: 0 !important;
        }

        .list>.mui-table-view-cell>ul>.mui-table-view-cell .mui-card-footer label {
            font-size: 12px !important;
            min-width: 98px;
            text-align: left;
            padding-right: 0 !important;
        }

        .list>.mui-table-view-cell>ul>.mui-table-view-cell .mui-card-footer .mui-radio input[type=radio] {
            top: 0 !important;
        }

        .list>.mui-table-view-cell>ul>.mui-table-view-cell .mui-card-footer .mui-radio input[type=radio]::before {
            font-size: 24px;
        }

        .clearfloat:after {
            display: block;
            clear: both;
            content: "";
            visibility: hidden;
            height: 0
        }

        .clearfloat {
            zoom: 1
        }

        .upload_img {
            width: 40px;
            height: 40px;
        }

        .padding_5 {
            padding: 5px;
        }

        .li_style {
            border-radius: 10px;
            margin-bottom: 10px;
            list-style: none
        }

        .no_border::after {
            height: 0 !important;
        }

        .no_padding {
            padding: 0 !important;
        }

        .no_margin {
            margin: 0 !important
        }
    </style>
</head>

<body>
    <div class="mui-content content-padded_top">
        <ul class="mui-table-view">
            <li class="mui-table-view-cell line">
                <div class="mui-table">
                    <p>TIS附件：</p>
                    <ul class="mui-table-view mui-table-view-chevron line">
                        <li class="mui-table-view-cell" id='ul_img'>
                            <script type="text/temmlate" id="tmpImgList">
                                {{each datas as item}}
                                <img class="mui-media-object" src="{{item.src}}" tapmode onclick="showRemotePicture(baseURL + 'downloadFile?docinfoid='+'{{item.docinfoid}}', '{{item.description}}')" /> {{/each}}--> {{each datas as item}}
                                <li class="mui-table-view-cell" onclick='uploadXlsx("{{item.docinfoid}}", "{{item.description}}")'>
                                    <span class="mui-h5">{{item.description}}</span>
                                </li>
                                {{/each}}
                            </script>
                        </li>
                    </ul>
                </div>
            </li>
        </ul>
        <div class="mui-content-padded fixed_btn_top">
            <ul class="mui-table-view mui-table-view-chevron">
                <li class="mui-table-view-cell detail">
                    <div class="mui-table">
                        <div class="mui-table-cell mui-col-xs-4">
                            <h5 class="mui-ellipsis">工单号：</h5>
                        </div>
                        <div class="mui-table-cell mui-col-xs-8 mui-text-right">
                            <span class="mui-h5" id='workorderid'></span>
                        </div>
                    </div>
                </li>
                <li class="mui-table-view-cell detail">
                    <div class="mui-table">
                        <div class="mui-table-cell mui-col-xs-4">
                            <h5 class="mui-ellipsis">工单名称：</h5>
                        </div>
                        <div class="mui-table-cell mui-col-xs-8 mui-text-right">
                            <span class="mui-h5" id='description'></span>
                        </div>
                    </div>
                </li>
                <li class="mui-table-view-cell detail">
                    <div class="mui-table">
                        <div class="mui-table-cell mui-col-xs-4">
                            <h5 class="mui-ellipsis">位置：</h5>
                        </div>
                        <div class="mui-table-cell mui-col-xs-8 mui-text-right">
                            <span class="mui-h5" id='location'></span>
                        </div>
                    </div>
                </li>
                <li class="mui-table-view-cell detail">
                    <div class="mui-table">
                        <div class="mui-table-cell mui-col-xs-4">
                            <h5 class="mui-ellipsis">关联工单号：</h5>
                        </div>
                        <div class="mui-table-cell mui-col-xs-8 mui-text-right">
                            <span class="mui-h5" id='wonum'></span>
                        </div>
                    </div>
                </li>
            </ul>
        </div>
        <div id='tmpDiv'>
            <!-- 模板引擎 -->
        </div>
    </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script src="../script/mui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../script/common.js" type="text/javascript" charset="utf-8"></script>
<script src="../script/template.js" type="text/javascript" charset="utf-8"></script>
<!-- 模板引擎 -->
<script type='text/tempalte' id='tmpList'>
    {{each datas as item index}}
    <div class="mui-card">
        <ul class="mui-table-view mui-table-view-chevron">
            <li class="mui-table-view-cell detail">
                <div class="mui-table">
                    <div class="mui-table-cell mui-col-xs-4">
                        <h5 class="mui-ellipsis text_blod">点检时间：</h5>
                    </div>
                    <div class="mui-table-cell mui-col-xs-8 mui-text-right">
                        <span class="mui-h5">{{item.modifydate}}</span>
                    </div>
                </div>
            </li>
            <li class="mui-table-view-cell detail">
                <div class="mui-table">
                    <div class="mui-table-cell mui-col-xs-4">
                        <h5 class="mui-ellipsis text_blod">问题描述：</h5>
                    </div>
                    <div class="mui-table-cell mui-col-xs-8 mui-text-right">
                        <span class="mui-h5"></span>
                    </div>
                </div>
            </li>
            <li class="mui-table-view-cell detail">
                <div class="mui-table">
                    <div class="mui-table-cell mui-col-xs-4">
                        <h5 class="mui-ellipsis text_blod">问题图片：</h5>
                    </div>
                    <div class="mui-table-cell mui-col-xs-8 mui-text-right">
                      {{each item.checkImgList as otem}}
                      <img class="mui-media-object" src="{{otem.src}}" tapmode onclick="showRemotePicture(baseURL + 'downloadFile?docinfoid='+'{{otem.docinfoid}}', '{{otem.description}}')" />
                      {{/each}}
                    </div>
                </div>
            </li>
            {{if item.status}}
            <li class="mui-table-view-cell detail">
                <div class="mui-table">
                    <div class="mui-table-cell mui-col-xs-4">
                        <h5 class="mui-ellipsis text_blod">状态：</h5>
                    </div>
                    <div class="mui-table-cell mui-col-xs-8 mui-text-right">
                        <span class="mui-h5">{{item.status}}</span>
                    </div>
                </div>
            </li>
            {{/if}}
        </ul>
    </div>
    {{/each}}
</script>
<script type="text/javascript">
    var page = 1;
    var loadEnd = false;
    var UILoading
    apiready = function() {
        UILoading = api.require('UILoading');
        onLoadData();
        Refresh(function() {
            loadEnd = false;
            page = 1;
            onLoadData(page, false);
        });
    }

    function onLoadData(page, load) {
        ajaxrd("queryTaskCheckPointDetail", {
            workorderid: api.pageParam.workorderid
        }, function(data) {
            api.refreshHeaderLoadDone();
            $api.text($api.byId('workorderid'), data.workorderid);
            $api.text($api.byId('description'), data.description);
            $api.text($api.byId('location'), data.location);
            $api.text($api.byId('wonum'), data.wonum);

            let arr = []
            data.taskList.forEach(function(item){
              item.checkResultList.forEach(function(otem){
                otem.checkImgList.forEach(function(ptem){
                  if(!ptem.docinfoid_sl) {
                    otem.hasImg = false
                  } else {
                    otem.hasImg = true
                    ptem.src = baseURL + 'downloadFile?docinfoid=' + ptem.docinfoid_sl
                  }
                })
                otem.modifydate = formatDate(otem.modifydate, 'YY-MM-DD hh:mm:ss')
                if(otem.checkIsGood == 1) {
                  otem.status = '良好'
                }
                if(otem.checkIsException == 1) {
                  otem.status = '异常'
                }
                if(otem.checkIsFaultopen == 1) {
                  otem.status = '故障开机'
                }
                if(otem.checkIsOpen == 1) {
                  otem.status = '未开机'
                }
                if (otem.modifydate || otem.hasImg || otem.status || otem.modifydate) {
                  arr.push(otem)
                }
              })
            })
            var html = template('tmpList', {datas: arr});
            $api.html($api.byId('tmpDiv'), html);
        })
    }
</script>

</html>
